Manages the sahders available in the component.
More...
Manages the sahders available in the component.
The manager is responsible for the allocated memory it returns. External code should never delete returned memory.
◆ ~ShaderManager()
nkGraphics::ShaderManager::~ShaderManager |
( |
| ) |
|
◆ isBuiltInShader()
bool nkGraphics::ShaderManager::isBuiltInShader |
( |
Shader * |
toTest | ) |
|
Checks whether a shader is built-in, aka offered by the component as a default solution.
- Parameters
-
toTest | The shader to test. |
- Returns
- If the shader is built-in (true) or not (false).
◆ createOrRetrieve()
Shader* nkGraphics::ShaderManager::createOrRetrieve |
( |
const std::string_view & |
name | ) |
|
Creates if unavailable, or retrieve if available, a shader.
- Parameters
-
name | The name of the shader to retrieve. |
- Returns
- Requested shader, possibly freshly created. The manager owns the memory alloated, external memory should not delete it. See eraseShader().
◆ get()
Shader* nkGraphics::ShaderManager::get |
( |
const std::string_view & |
name | ) |
|
Retrieves an existing shader.
- Parameters
-
name | The name of the shader to retrieve. |
- Returns
- The shader if available, nullptr else.
◆ getByIndex()
Shader* nkGraphics::ShaderManager::getByIndex |
( |
unsigned int |
index | ) |
|
Retrieves a shader by index. Note that an index can point to different shaders as the memory of the manager is changed. Useful to loop over all available shaders in one go.
- Parameters
-
index | The index of the shader to retrieve. |
- Returns
- The shader linked if available, nullptr else.
◆ rename()
void nkGraphics::ShaderManager::rename |
( |
const std::string_view & |
oldName, |
|
|
const std::string_view & |
newName |
|
) |
| |
Renames a shader, changing both its name and the way to find it in the manager.
- Parameters
-
oldName | The name of the shader to alter. |
newName | The new name to assign. |
◆ erase()
void nkGraphics::ShaderManager::erase |
( |
const std::string_view & |
name | ) |
|
Erases a shader and frees its memory.
- Parameters
-
name | The name of the shader to erase. |
The documentation for this class was generated from the following file: